#!/usr/bin/env python 

import numpy

from specks import *

s = Speck()

for i in range(16):
    s.addAtom('Al', numpy.random.normal(0, 2, 3))

beam.speck = s
beam.start()

m = Morse()

qm = QuickMin(s, m)
m.force(s)
while norm(s.f) > 8.0:
    qm.step()

nve = NVE(s, m)

while beam.running:
    nve.step()
    m.energy(s)
    T = 0.0
    for i in range(len(s)):
        T += 0.5 * s.m[i][0] * norm(s.v[i])**2    
    print "Energy:",  s.u + T
    
    


